let num = 2323
let result = []
for (let i = 2; i < num; i++) {
  let b = num / i
  if (Number.isInteger(b)) {
    if (isSu(i) && isSu(b)) {
      if (i < b) {
        result.push(i, b)
      } else {
        result.push(b, i)
      }
      break
    }
  }
}
if (result.length) {
  // result.sort()
  console.log(result.join(' '))
} else {
  console.log('-1 -1')
}

function isSu(val) {
  for (let i = 2; i < val; i++) {
    if (val % i === 0) {
      return false
    }
  }
  return true
}
